﻿@{
    ViewBag.Title = "ImportData";
}
@section scripts
{
    <script src="@Url.Content("~/Scripts/shared/share.js")" type="text/javascript"></script> 
    <style>
        .sel_btn{
            height: 25px;
            line-height: 25px;
            padding: 0 11px;
            background: #02bafa;
            border: 1px #26bbdb solid;
            border-radius: 3px;
            /*color: #fff;*/
            display: inline-block;
            text-decoration: none;
            font-size: 14px;
            outline: none;
            color:white;
        }
        .ch_cls{
            background: #e4e4e4;
        }
        h1 {
            height:0px;
            border:1px solid #cecece;
            margin-top:20px;
            margin-bottom:20px;
        }
    </style>
}
<div style="margin:10px;">
    <span style="font-size:14pt"><a href="../templet/导入模板.xls" class="sel_btn" target="_blank">下载模板</a></span>
</div>
<h1></h1>
<div style="margin-top:10px;margin-left:10px;">
    <form action="../Bill/UploadFile" method="post" enctype="multipart/form-data" target="target">
     <input type="file" name="file" />
     <input type="submit" value="导 入" />
    </form>
    <iframe name="target" id="target" width="0" height="0"></iframe>
</div>
<script>
    function isIE() { //ie?
        if (!!window.ActiveXObject || "ActiveXObject" in window)
            return true;
        else
            return false;
    }
    $(function () {
        $("#target").hide();
        var obj;
        $("#target").on('load', function () {
            obj = $(this);
            var str;
            if(isIE())
                str = obj[0].contentDocument.body.outerText;
            else
                str = obj[0].contentDocument.body.textContent;
            var Data = JSON.parse(str);
            CloseWindow(Data.data);
        });
    });
</script>